import { Component, OnInit, ViewChild } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { JSONEditorComponent } from 'ngx-jsoneditor';

import { ConfigmanageService, AppConfig } from '../../../DM/configmange.service';
import { AppManageService, App } from '../../../DM/appmanage.service';
@Component({
  selector: 'app-configuration-management',
  templateUrl: './configuration-management.component.html',
  styleUrls: ['./configuration-management.component.css']
})
export class ConfigurationManagementComponent implements OnInit {
  // 组件 https://github.com/devmark/ngx-jsoneditor
  _appLs: App[] = [];
  _data: any;
  @ViewChild('staticModal') _staticModal: JSONEditorComponent;
  constructor(
    private configmanageService: ConfigmanageService,
    private appManageService: AppManageService,
    private activatedRoute: ActivatedRoute,
  ) { }

  async ngOnInit() {
    this.activatedRoute.params.subscribe((router) => {
      console.log(router);
    });
    this._staticModal.focus();
  }

  _updateJson() {
    console.log(JSON.stringify(this._data));
  }
}
